//-------------------------------------------------------------------
//	Copyright (c) 2012-2014 Zhirnov Andrey
//	This file is part of the "UXGEN-ES" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#pragma once

#include "Platforms/Base/IApplication.h"

#if defined( PLATFORM_SDL )


namespace Engine
{
namespace Platforms
{


	//
	// SDL OpenGL Library
	//

	struct SDLLibOpenGL
	{
	// methods
	public:
		SDLLibOpenGL ()
		{
		}

		~SDLLibOpenGL ()
		{
			Unload();
		}

		bool Load (uni_c_string name = uni_c_string())
		{
			return ::SDL_GL_LoadLibrary( name.Empty() ? GetDefaultName() : name.cstr() ) == 0;
		}

		void Unload ()
		{
			::SDL_GL_UnloadLibrary();
		}

		void * GetProc (const char *address) const
		{
			return ::SDL_GL_GetProcAddress( address );
		}

		static const char * GetDefaultName ()
		{
			return null;
		}
	};


}	// Platforms


namespace Base
{
	typedef Platforms::SDLLibOpenGL		LibOpenGL;

}	// Base
}	// Engine

#endif	// PLATFORM_SDL